package utils;

import java.awt.Dimension;
import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;

public class imageButton extends JButton {
	public imageButton(String img,int width,int height){
		Icon icon = new ImageIcon(img);
		setPreferredSize(new Dimension(width,height));
		setSize(width, height);
		setBorderPainted(false); 
		setContentAreaFilled(false); 
		setFocusPainted(false); 
		setOpaque(false);
		Action action = new AbstractAction("", icon) {
		    public void actionPerformed(ActionEvent evt) {
		       //
		    }
		};
		setAction(action);
	}
}
